package com.io.exception;


import com.io.constant.ApiResultEnum;

/**
 * The class/interface 自定义异常
 *
 * @author guod
 * @version 1.0 use jdk 1.8
 */
public class SelfException extends RuntimeException {
    private Integer code;

    public SelfException(ApiResultEnum apiResultEnum) {
        super(apiResultEnum.getMessage());
        this.code = apiResultEnum.getCode();
    }

    public SelfException(String message) {
        super(message);
    }

    public SelfException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
